/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package search;

import agents.Agent;
import env.Action;
import env.Enviroment;
import javax.swing.ImageIcon;

/**
 *
 * @author user
 */
public class RealTimeAgent extends Agent {

    private int expanded_nodes = 0;
    private NodeQueue queue;

    public RealTimeAgent(String name, int row, int col, NodeQueue queue) {
        super(name, row, col);
        super.setIcon(new ImageIcon("images/cow.jpg"));
        this.queue = queue;
    }

    @Override
    public Action getMove() {
        System.out.println("before replanning, my performance measure is " + Enviroment.f + "*" + score + " - " + expanded_nodes + " = " + ((Enviroment.f * score) - expanded_nodes));
        long start = System.currentTimeMillis();
        //expanded_nodes+=treeSearch(queue, state, plan);
        Action ans = realTimeSearch();
        long finish = System.currentTimeMillis();
        System.out.println("search time="+ (finish-start) + ",  move="+ans);
        return ans;
    }

    /**********************************************************************
     **********************************************************************
     * 
     *        search-related stuff
     * 
     ***********************************************************************
     ***********************************************************************
     */
    
    private Action realTimeSearch() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
